<template>
  <div class="home">
    <blg-heand></blg-heand>
    <h1>欢迎来到我的博客！</h1>
    <!-- <h1>{{count}}</h1>
    <h1>{{$store.state.token}}</h1>
    <button @click="add"> ++</button> -->
     <div class="content">
       <!-- 轮播图 -->
       <div class="photoshow">
        <el-row>

       <el-carousel :interval="4000" type="card" height="350px">
          <el-carousel-item v-for="item in imglist" :key="item.id">
            <img :src="item.imgsrc" class="image">
          </el-carousel-item>
        </el-carousel>

        <el-image v-for="item in srcList" :key="item" :src="item"></el-image>

        </el-row>
       </div>
        
    </div>
 

    <blg-footer></blg-footer>
  </div>
</template>

<script>
import heander from '../components/header.vue'
import fotter from '../components/footer.vue'
export default {
  name: 'Home',
  components: {
   'blg-heand': heander,
   'blg-footer': fotter
  },
   data() {
      return {
        imglist: [
          {id:0,imgsrc:'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'},
          {id:1,imgsrc:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.uc1z.com%2Fwp-content%2Fuploads%2F2020%2F06%2F1591761829_894120.jpg&refer=http%3A%2F%2Fwww.uc1z.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1648891570&t=eb59287c29e7ce2112dcc739b21c3ed9'},
          {id:2,imgsrc:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.cdncl.net%2Fgame%2Fuser_upload%2Fcero_ss%2F784321d2aa3b4b26c643ae69825664c9.jpg&refer=http%3A%2F%2Fpic1.cdncl.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1648891570&t=a2bb1996a14c0ac1c3416390b3fba7e8'},
          {id:3,imgsrc:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fdingyue.ws.126.net%2F2020%2F0414%2Fbc63afd8p00q8runa02pjc001hc00u0m.png&refer=http%3A%2F%2Fdingyue.ws.126.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1648891570&t=731fa425bbdd0edbcbc138250260fb96'}
        ],
        src: [
            '春眠不觉晓',
            '处处闻啼鸟',
            '夜来风雨声',
            '花落知多少'],
            srcList: [
          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
            ],
      }
    },
    methods:{
      add(){
      this.$store.commit('add');
      console.log("加了一次");
      console.log(this.$store.state);
    }
    },
    computed:{
      count () {
      return this.$store.state.count
    },
      
    }
}
</script>

<style scoped>
.photoshow{
  width: 100%;
  margin: 0px auto;
}
.image{
  width: 100%;
  height: 100%;
}
.el-carousel__item h3 {
    color: #373e47;
    font-size: 24px;
    opacity: 0.55;
    margin: auto;
  }
.el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>